//package com.asset.salesforce.dao;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import org.hibernate.Query;
//import org.hibernate.Session;
//import org.hibernate.SessionFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Repository;
//
//import com.asset.salesforce.domain.Employee;
//import com.asset.salesforce.domain.LeadStatus;
//
//@Repository
//public class LeadStatusDaoImpl {
//	
//	@Autowired
//	SessionFactory sessionFactory;
//	
//	@SuppressWarnings("unchecked")
//	public LeadStatus getLeadStatusById(Integer id){
//		 Session session = sessionFactory.getCurrentSession();
//		 Query query = session.createQuery("from LeadStatus where id=  :id");
//		 query.setParameter("id", id);
//		 List<LeadStatus>list = new ArrayList<LeadStatus>();
//		  list = query.list();
//		 if(list.size() >0 ){
//			 return list.get(0);
//		 }else{
//			 return new LeadStatus();
//		 }
//		 
//	}
//	
//	public LeadStatus getLeadStatusByName(String name){
//		 Session session = sessionFactory.getCurrentSession();
//		 Query query = session.createQuery("from LeadStatus where leadStatus=  :name");
//		 query.setParameter("name", name);
//		 List<LeadStatus>list = new ArrayList<LeadStatus>();
//		  list = query.list();
//		 if(list.size() >0 ){
//			 return list.get(0);
//		 }else{
//			 return null;
//		 }
//		 
//	}
//	
//	@SuppressWarnings("unchecked")
//	public List<LeadStatus> getAllLeadStatus(){
//		 Session session = sessionFactory.getCurrentSession();
//		 Query query = session.createQuery("from LeadStatus as l order by l.id");
//		 List<LeadStatus>list = query.list();
//		 return list;
//	}
//
//
//}
